<?xml version="1.0" encoding="windows-1250"?>
<!--
  This style is not used anymore. Replaced by gen_masterdiff.xsl.
-->
<gxsl:stylesheet xmlns:gxsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/TransformAlias" xml:space="default">
  <gxsl:namespace-alias stylesheet-prefix="xsl" result-prefix="gxsl"/>
  <gxsl:output method="xml" encoding="windows-1250" indent="yes"/>
  
  <gxsl:param name="cvincludepage"/>
  <gxsl:param name="lang">cs</gxsl:param>
  
  <gxsl:template match="/">
    <xsl:stylesheet version="1.0" xmlns:d="http://www.metada.com/xda/diff">
      <xsl:output method="html" indent="no" encoding="windows-1250"/>
      <gxsl:apply-templates select="$cvincludepage/ancestor::CView"/>
    </xsl:stylesheet>
  </gxsl:template>

  <gxsl:template match="CView">

    <gxsl:variable name="dict" select="document('dictionary.xml')/Translation"/>

    <xsl:template match="coverer_{CVInclude/@concept}[{CVInclude/@nickcoll}/{CVInclude/@nickname}]">
      <h3><gxsl:value-of select="CVInclude/CVITitles/CVITitle[@id_cttype='listtitle' and @id_lang=$lang]/Title"/></h3>
      <p>
        <gxsl:apply-templates select="CVInclude"/>
      </p>
    </xsl:template>
 
  </gxsl:template>


  <gxsl:template match="CVInclude">
  
    <xsl:if test="{@nickcoll}[@d:st]">
      <xsl:for-each select="{@nickcoll}/{@nickname}">

        <gxsl:variable name="title_real">
          <gxsl:value-of select="CVITitles/CVITitle[@id_cttype='maintitle' and @id_lang=$lang]/Title"/>
        </gxsl:variable>
        <xsl:variable name="title">
          <gxsl:choose>
            <gxsl:when test="$title_real!=''"><gxsl:value-of select="$title_real"/></gxsl:when>
            <gxsl:otherwise><gxsl:value-of select="@nickcoll"/></gxsl:otherwise>
          </gxsl:choose>
          <gxsl:text>: </gxsl:text>
          <gxsl:choose>
            <gxsl:when test="count(CVIProperties/CVIProperty[@onlabel='1'])>0">
              <gxsl:for-each select="CVIProperties/CVIProperty[@onlabel='1']">
                <gxsl:choose>
                  <gxsl:when test="@attr='1'">
                    <xsl:value-of select="@{@nicknamelow}"/><xsl:text>&#160;&#160;&#160;</xsl:text>
                  </gxsl:when>
                  <gxsl:otherwise>
                    <xsl:value-of select="{@nickname}/text()"/><xsl:text>&#160;&#160;&#160;</xsl:text>
                  </gxsl:otherwise>
                </gxsl:choose>
              </gxsl:for-each>
            </gxsl:when>
            <gxsl:otherwise>
              <gxsl:for-each select="CVIProperties/CVIProperty[@key='1']">
                <xsl:value-of select="@{@nicknamelow}"/><xsl:text>&#160;&#160;&#160;</xsl:text>
              </gxsl:for-each>
            </gxsl:otherwise>
          </gxsl:choose>
        </xsl:variable>
  
        <table><tr><td width="10"></td>
  
          <td valign="top">
          
          <xsl:choose>
            <xsl:when test="../@d:st='add'">
              <font class="diff_objtitle_new"><xsl:value-of select="$title"/></font><br/>
            </xsl:when>
            <xsl:when test="../@d:st='remove'">
              <font class="diff_objtitle_old"><xsl:value-of select="$title"/></font><br/>
            </xsl:when>
            <xsl:otherwise>
              <font class="diff_objtitle"><xsl:value-of select="$title"/></font><br/>
            </xsl:otherwise>
          </xsl:choose>
        </td></tr></table>
  

      </xsl:for-each>
    </xsl:if>
    <xsl:for-each select="{@nickcoll}/{@nickname}[descendant-or-self::*/@d:st or descendant-or-self::*/d:attr or descendant-or-self::*/d:text]">
      <gxsl:variable name="title_real">
        <gxsl:value-of select="CVITitles/CVITitle[@id_cttype='maintitle' and @id_lang=$lang]/Title"/>
      </gxsl:variable>
      <xsl:variable name="title">
        <gxsl:choose>
          <gxsl:when test="$title_real!=''"><gxsl:value-of select="$title_real"/></gxsl:when>
          <gxsl:otherwise><gxsl:value-of select="@nickcoll"/></gxsl:otherwise>
        </gxsl:choose>
        <gxsl:text>: </gxsl:text>
        <gxsl:choose>
          <gxsl:when test="count(CVIProperties/CVIProperty[@onlabel='1'])>0">
            <gxsl:for-each select="CVIProperties/CVIProperty[@onlabel='1']">
              <gxsl:choose>
                <gxsl:when test="@attr='1'">
                  <xsl:choose>
                    <xsl:when test="d:attr[@name='{@nickname}' and (@st='mod' or @st='add')]">
                      <xsl:value-of select="d:attr[@name='{@nickname}' and (@st='mod' or @st='add')]/@b"/><xsl:text>&#160;&#160;&#160;</xsl:text>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:value-of select="@{@nicknamelow}"/><xsl:text>&#160;&#160;&#160;</xsl:text>
                    </xsl:otherwise>
                  </xsl:choose>
                </gxsl:when>
                <gxsl:otherwise>
                  <xsl:choose>
                    <xsl:when test="d:text[@name='{@nickname}' and (@st='mod' or @st='add')]">
                      <xsl:value-of select="d:text[@name='{@nickname}' and (@st='mod' or @st='add')]/d:b"/><xsl:text>&#160;&#160;&#160;</xsl:text>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:value-of select="{@nickname}/text()"/><xsl:text>&#160;&#160;&#160;</xsl:text>
                    </xsl:otherwise>
                  </xsl:choose>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:for-each>
          </gxsl:when>
          <gxsl:otherwise>
            <gxsl:for-each select="CVIProperties/CVIProperty[@key='1']">
              <xsl:value-of select="@{@nicknamelow}"/><xsl:text>&#160;&#160;&#160;</xsl:text>
            </gxsl:for-each>
          </gxsl:otherwise>
        </gxsl:choose>
      </xsl:variable>

      <table><tr><td width="10"></td>

        <gxsl:if test="name(..)='CView'">
          <form name="selection">
            <td valign="top">
              <xsl:choose>
                <xsl:when test="@d:st='add' or .//node()/@d:st='add'">
                  <span class="sync_delete"><input type="checkbox" name="delete" onclick=""/></span>
                </xsl:when>
              </xsl:choose>
              <xsl:choose>
                <xsl:when test="@d:st='remove' or .//node()/@d:st='remove'">
                  <span class="sync_insert"><input type="checkbox" name="insert" onclick=""/></span>
                </xsl:when>
              </xsl:choose>
              <xsl:choose>
                <xsl:when test=".//d:attr or .//d:text">
                  <span class="sync_update"><input type="checkbox" name="update" onclick=""/></span>
                </xsl:when>
              </xsl:choose>
              <!--<textarea name="xml" style="visibility: hidden; width: 1; height: 1;">&lt;coverer_<xsl:value-of select="name(.)"/>&gt;&lt;<xsl:value-of select="name(..)"/>&gt;<xsl:copy-of select="."/>&lt;/<xsl:value-of select="name(..)"/>&gt;&lt;/coverer_<xsl:value-of select="name(.)"/>&gt;</textarea>-->
              <textarea name="xml" style="visibility: hidden; width: 1; height: 1;"><xsl:text disable-output-escaping="yes">&lt;</xsl:text><gxsl:value-of select="../@name"/><xsl:text disable-output-escaping="yes">&gt;&lt;</xsl:text><gxsl:value-of select="@nickcoll"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text><xsl:copy-of select="."/><xsl:text disable-output-escaping="yes">&lt;</xsl:text>/<gxsl:value-of select="@nickcoll"/><xsl:text disable-output-escaping="yes">&gt;&lt;</xsl:text>/<gxsl:value-of select="../@name"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text></textarea>
              <input type="hidden" name="cv" value="coverer_{@concept}"/>
            </td>
          </form>
        </gxsl:if>
        <td valign="top">
        
        <xsl:choose>
          <xsl:when test="@d:st='add'">
            <font class="diff_objtitle_new"><xsl:value-of select="$title"/></font><br/>
          </xsl:when>
          <xsl:when test="@d:st='remove'">
            <font class="diff_objtitle_old"><xsl:value-of select="$title"/></font><br/>
          </xsl:when>
          <xsl:otherwise>
            <font class="diff_objtitle"><xsl:value-of select="$title"/></font><br/>
          </xsl:otherwise>
        </xsl:choose>

        
        <xsl:if test="count(d:attr)>0 or count(d:text)>0">
          <table><tr><td width="10"></td><td>
            <gxsl:for-each select="CVIProperties/CVIProperty">
              <gxsl:choose>
                <gxsl:when test="@attr='1'">
                  <xsl:for-each select="d:attr[@name='{@nicknamelow}']">
                    <xsl:call-template name="show_attr_diff">
                      <xsl:with-param name="prop_title"><gxsl:value-of select="Title"/></xsl:with-param>
                    </xsl:call-template>
                  </xsl:for-each>
                </gxsl:when>
                <gxsl:otherwise>
                  <xsl:for-each select="d:text[@name='{@nickname}']">
                    <xsl:call-template name="show_text_diff">
                      <xsl:with-param name="prop_title"><gxsl:value-of select="Title"/></xsl:with-param>
                    </xsl:call-template>
                  </xsl:for-each>
                </gxsl:otherwise>
              </gxsl:choose>
            </gxsl:for-each>
          </td></tr></table>
        </xsl:if>
        
        <gxsl:apply-templates select="CVIRels/CVIRel/CVInclude"/>
      </td></tr></table>
    </xsl:for-each>
  </gxsl:template>


</gxsl:stylesheet>
